<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/>
    <title></title>
	<script type="text/javascript" src="js/jquery-min.js"></script>
	<script type="text/javascript" src="js/cookie.js"></script>
	<!--<script type="text/javascript" src="js/mission.js"></script>-->
	<script type="text/javascript" src="js/move.js"></script>
	<script type="text/javascript" src="js/Universal%20template.js"></script>
<!--	由于在本页面acceptMission与getMission.js 功能重复，注释掉-->
<!--	<script type="text/javascript" src="js/acceptMission.js"></script>-->
	<script type="text/javascript" src="js/drag.js"></script>
	<script type="text/javascript" src="js/getMissions.js"></script>
	<script type="text/javascript" src="js/getUsers.js"></script>
	<script type="text/javascript" src="js/indexJs.js"></script>
	<link rel="stylesheet" type="text/css" href="css/popping.css">
	<link rel="stylesheet" type="text/css" href="css/index.css"/>
	<link rel="stylesheet" type="text/css" href="fontawesome/fontawesome-free-5.10.2-web/css/all.min.css"/>
	
</head>

<body>
	<div id="all">
		<div id="navgation" class="navigation">
			<div id="user_image">
				<div class="navForm">
					<div class="navForm-1">
					</div>
					<div class="navForm-2">	
					</div>
					<div class="navForm-1">	
					</div>
				</div>
				<div class="user_image"><img></div>
			</div>
			<former id="search_pack">
				<input id="search" type="text" value="" onkeydown="return getEnterKey(event)"/>
			</former>
			<i class="fa fa-search" aria-hidden="true" onclick=searchforMission()></i>
			<!--
			<div id="user_email" onclick="searchforMission()"></div>
			<div id="user_group"></div>
			-->
		</div>
		<div class="container">
			<!--已删除轮播图-->
			<div class="containerImg">
				<ul id="imgList">
					<li><img src="img/3.jpg"/></li>
					<li><img id="containerImg" src="img/1.jpg" href="#"></li>
					<li><img src="img/2.jpg"/></li>
					<li><img src="img/3.jpg"/></li>
					<li><img src="img/1.jpg"/></li>
				</ul>
				<div id="navDiv"> 
					<a href="javascript:;"></a>
					<a href="javascript:;"></a>
					<a href="javascript:;"></a>
				</div>
			</div>
			<div class="containerList">
				<div class="containerList-1">
					<div><li style="background-image: url(img/icon-1.png);"></li><p>学工</p></div>
					<div><li style="background-image: url(img/icon-2.png);"></li><p>师生</p></div>
					<div><li style="background-image: url(img/icon-3.png);"></li><p>ic卡</p></div>
					<div><li style="background-image: url(img/icon-4.png);"></li><p>财务</p></div>
				</div>
				<!--
				<div class="containerList-1">
					<div><li></li><p>未定</p></div>
					<div><li></li><p>未定</p></div>
					<div><li></li><p>未定</p></div>
					<div><li></li><p>未定</p></div>
				</div>
				-->
			</div>
		</div>
		<div id="missions">
			<div id="elasticFrame">
				<div id="mission">
					<span id="closeBtn">X</span>
				</div>
				<div id="background"></div>
			</div>
		</div>
		<div id="bottom" class="bottom">
			<div id="missionPublish" onclick="window.location.href='missionPublish.html'">
				<div class="cross" id="crossBtn">
					<div class="cross_a"></div>
					<div class="cross_b"></div>
				</div>
			</div>   
			<div  class="buttomRight">
				<p ><a href="rankingList.html"><i class="fa fa-address-card" aria-hidden="true"></i></a></p>
			</div>
			<div class="buttomLeft">
				<p><a href="missionPlatform.html" style="text-decoration: none;"><i class="fa fa-th" aria-hidden="true"></i></a></p>
			</div>  
		</div>
	</div>
	
	<div id="user" class="user">
		<div class="user_page">
			<!--头像格子-->
			<div id="avatar">
				<a href="selfInformation.html" ><img src="img/avatar.jpg"></a>
				<p id="username1">userName</p>
				<p class="userSignature" id="number">this is signature</p>
			</div>
			<!--列表格子-->
			<div class="userForm">
				<div class="mission">
					<p>查看奖惩记录</p>
				</div>
				<div class="history">
					<p>查看个人成绩</p>
				</div>
				<div class="shop">
					<p>开发者反馈</p>
				</div>
			</div>
		</div>
		<div id="back_page" class="back_page"></div>
	</div>


    <script>
		//createMissionIndex('用户名','2019-2-2 13:12:13','帮助计算机学院清理卫生','这里是内容','5','3','20185399','check','12',"天津理工大学",'地点：28号楼B109');
        var selectMissionList;
        if(getCookie("selectResults")==null||getCookie("selectResults").trim()==""){
            console.log("cookie的值为空");
        }
        if(true){
                //标记是否从搜索页面转来
                var bool=true;
                search="";
                var data=search;
                $.ajax({
                    type:"post",
                    dataType:"text",
                    url:"/fp_war_exploded/liuGetMission",
                    data:data,
                    success:function (result) {
						result=result.replace(/[\r\n]/g,"");
                        missionList=result;
                        if(bool){
                            //alert(missionList);
                            document.cookie="selectResults="+result;
                            missionList=JSON.parse(missionList);

                            var recipient;
                            for(var i=0;i<missionList.length;i++){
                                if(missionList[i].recipient==null||missionList[i].recipient.trim()==""){
                                    recipient="false";
                                }
                                else{
                                    recipient="true";
                                }
                                createMissionIndex(missionList[i].author,missionList[i].createTime,missionList[i].title,missionList[i].content,missionList[i].reward,"接受者",missionList[i].recipient,"发送者学号:"+missionList[i].userid,recipient,missionList[i].reward,missionList[i].place,missionList[i].id);
								(document.getElementById(missionList[i].id).parentNode).addEventListener("click",missionTouch,false);
                            }
                            var missionOut = document.getElementById("mission");
                            var elasticFrame = document.getElementById("elasticFrame");
							function missionTouch(){
								missionOut.appendChild(title("div",this));
								document.body.style.overflow = "hidden";
								elasticFrame.style.display = "block";
							}
                            //window.location.href="missionPlatform.html";
                        }
                    },
                    error:function (result) {
                        alert("87Line Search error");
                    }
                });
        }
		function acceptName(ele){
			var id=ele.id;
			var sentence="accept";
			var recipient=getCookie("Number");
			var data={
				id:id,
				recipient:recipient,
				sentence:sentence
			};
			$.ajax({
				type:"post",
				dataType:"text",
				url:"/fp_war_exploded/updateMission",
				data:JSON.stringify(data),
				success:function (result) {
					if (result.trim()=="success"){
						alert("成功");
					}
					else{
						alert("error");
					}
				},
				error:function (result) {
					alert("87Line Search error");
				}
			});
		}
        //由于js重复 注释掉
		// $(document).ready(function () {
		// 			$("button.accept").click(function () {
		// 				alert("accept");
		// 				acceptName(this);
		// 			});
		// 			$("button.think").click(function () {
		// 				alert("think");
		// 			});
		// 		}
		// );
    </script>
	<script defer type="text/javascript" src="js/lianxudenglu.js"></script>
</body>
</html>